package com.znh.kuiklyuniversity.compose

import androidx.compose.runtime.Composable
import com.tencent.kuikly.compose.ComposeContainer
import com.tencent.kuikly.compose.coil3.rememberAsyncImagePainter
import com.tencent.kuikly.compose.foundation.Image
import com.tencent.kuikly.compose.foundation.layout.Column
import com.tencent.kuikly.compose.foundation.layout.fillMaxSize
import com.tencent.kuikly.compose.foundation.layout.height
import com.tencent.kuikly.compose.foundation.layout.width
import com.tencent.kuikly.compose.foundation.shape.RoundedCornerShape
import com.tencent.kuikly.compose.setContent
import com.tencent.kuikly.compose.ui.Modifier
import com.tencent.kuikly.compose.ui.draw.clip
import com.tencent.kuikly.compose.ui.graphics.Color
import com.tencent.kuikly.compose.ui.layout.ContentScale
import com.tencent.kuikly.compose.ui.unit.dp
import com.tencent.kuikly.core.annotations.Page
import com.tencent.kuikly.core.base.attr.ImageUri
import com.tencent.kuikly.core.module.RouterModule
import com.tencent.kuikly.core.nvi.serialization.json.JSONObject
import com.znh.kuiklyuniversity.compose.widgets.TitleLayout

@Page("detailpage", supportInLocal = true)
internal
class DetailPage : ComposeContainer() {
    override fun willInit() {
        super.willInit()
        setContent { detailPage(this) }
    }
}

@Composable
fun detailPage(ct: ComposeContainer) {
    Column(modifier = Modifier.fillMaxSize()) {
        TitleLayout(title = "详l情", backAction = {
            ct.acquireModule<RouterModule>(RouterModule.MODULE_NAME)
                .closePage()

        })
        Image(
            painter = rememberAsyncImagePainter(ImageUri.SCHEME_COMMON_ASSETS + "commonimage/image_banner_user.png"),
            contentDescription = "图标",
            contentScale = ContentScale.Fit,
            modifier = Modifier.fillMaxSize()
        )
    }

}